"""
    Adelide - A virtual media bookshelf.
    Copyright (C) Niklas Johansson jonikl@ituniv.se

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
"""

## Media provides a good structure for the rest of the project. And provide a wrapper class for the objects inside the system.
#
# This class holds a bunch of different class variables to reassamble the database representation of a media object.

class Media(object):

    ## __init__ is the constructor for a media object.
    #
    # This constructor should be used for creating a media object which you already have the information
    # to. I.e when you fetch the media from the database.
    # 
    # @param self The object pointer.
    # @param title A string which specifies the title of the media object.
    # @param year An integer representation for a year.
    # @param cover An absolute path to the media cover.
    # @param ean A string representing the barcode EAN.
    # @param rating An integer between 1 and 5.
    # @param favorite A boolean value True of False if this is a user selected favorite.
    # @param format_id An integer that represents the format_id.
    # @param type_id An integer that represents the type_id.
    # @param studio_id An integer that represents the studio_id.
    # @param publisher_id An integer that represents the publisher_id.
    # @param tags A list of strings representing the tags connected to the specified media_id.
    # @param humans A list of humans representing the humans connected to the specified media_id.
    def __init__(self, title, year, cover, ean, rating, favorite, format_id, type_id, studio_id, publisher_id, tags, humans):
        self.media_id = -1
        self.title = title
        self.year = year
        self.cover = cover
        self.ean = ean
        self.rating = rating
        self.favorite = favorite
        self.format_id = format_id
        self.type_id = type_id
        self.studio_id = studio_id
        self.publisher_id = publisher_id
        self.tags = tags
        self.humans = humans
    ## __init__ is the constructor for a new media object.
    #
    # It takes no parameters to create a new object.
    def __init__(self):
        self.media_id = -1
        self.title = ""
        self.year = -1
        self.cover = ""
        self.ean = ""
        self.rating = -1
        self.favorite = -1
        self.format_id = -1
        self.type_id = -1
        self.studio_id = -1
        self.publisher_id = -1
        self.tags = []
        self.humans = []

